package com.gurun.camera.device.model.impl;

import com.danale.sdk.Danale;
import com.danale.sdk.iotdevice.func.garagedoor.GarageDoorFunc;
import com.danale.sdk.iotdevice.func.garagedoor.result.BaseGarageDoorResult;
import com.danale.sdk.iotdevice.func.garagedoor.result.ControlGarageDoorResult;
import com.danale.sdk.platform.cache.DeviceCache;
import com.gurun.camera.device.model.ControlManager;

public class ActionControlManager extends ControlManager {

    public ActionControlManager(){}

    @Override
    public void setId(String id) {
        super.setId(id);
        device = DeviceCache.getInstance().getDevice(id);
    }

    @Override
    public void controlGarageDoor(int on) {
        super.controlGarageDoor(on);
        Danale.get().getIotDeviceService().getGarageDoorFunc(device)
                .controlGarageDoor(1, new GarageDoorFunc.GarageDoorHandler() {
                    @Override
                    public void onSuccess(BaseGarageDoorResult result) {
                        ControlGarageDoorResult cgdResult = ((ControlGarageDoorResult) result);
                    }

                    @Override
                    public void onFailed(int errorCode) {

                    }
                });
    }
}
